#set(title = "相册列表")
#@layoutToo()
#define main()
<table class="table tpl-table table-td-break ">
    <table>
    <form id="form" action="/blog/admin/uploadImg" class="test" method="post" enctype="multipart/form-data">
        <input type="file" id="file" name="file" >
        <input type="text" style="width: 260px" name="message" placeholder="请添加图片文字说明或者信息" >
        <input type="submit" onclick="" id="btn" value="上传">
    </form>
    </table>
    <form action="/blog/admin/batchDeleteImg" method="post">
        <table>
    <thead>
    <tr>
        <th><input name="" type="checkbox" value="" onclick="swapCheck()"/></th>
        <th></th>
        <th width="50%">图片</th>
        <th>blog对应id</th>
        <th>图片说明</th>
        <th>基本操作</th>
    </tr>
    </thead>
    <h3>数量：#(album.totalRow)</h3>
    #if(album.totalRow > 0)
    <tbody>
    #for(album : album.list)
    <tr>
        <th><input name="List" type="checkbox" value="#(album.id)"/></th>
        <th width="" type="checkbox" class="">#(for.count)</th>
        <th width="50%" type="checkbox" class=""><img src="#(album.suffix)#(album.base64)" style="width: 240px;"></th>
        <th width="" type="checkbox" class="">#(album.id)</th>
        <th width="" type="checkbox" class="">#(album.message)</th>
        <th width="" type="checkbox" class=""><a href="/blog/admin/deleteImg?id=#(album.id)">删除</a><th>
    </tr>
    #end
    <tr><th colspan="7">
        <input type="submit" value="删除" class="btn " id="submit1"/>
    </th></tr>
    </tbody>
    #else
    <p class="center">没有数据...</p>
    #end
        </table>
</form>
</table>
#include("/WEB-INF/view/common/blog_paginate.html")
#@paginate(album.pageNumber, album.totalPage, actionUrl, urlParams)
#end
<script>
    //checkbox 全选/取消全选
    var isCheckAll = false;
    function swapCheck() {
        if (isCheckAll) {
            $("input[type='checkbox']").each(function () {
                this.checked = false;
            });
            isCheckAll = false;
        } else {
            $("input[type='checkbox']").each(function () {
                this.checked = true;
            });
            isCheckAll = true;
        }
    }
</script>
